/*
 * =====================================================================================
 *
 *       Filename:  action.h
 *
 *    Description:  define class of action
 *
 *        Version:  1.0
 *        Created:  2009年08月01日 23时06分06秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Gestrom Drawn (mn), zhcfreesea@gmail.com
 *        Company:  zhc
 *
 * =====================================================================================
 */

#ifndef _ACTION_H
#define _ACTION_H

#include<map>
#include<string>

typedef enum{SUCCESS, FAIL} ActionResult;
typedef struct {
    bool operator()(std::string s1, std::string s2) const
    {
        return s1 > s2;
    }
}ltstr;

class Action
{
    private:

        std::map<const std::string, ActionResult (*) (), ltstr> _actions;

        static ActionResult _action_eat();
        static ActionResult _action_sleep();

        //FIXME:_current_action can only be "eat" and "sleep"(for now), how to implement?
        std::string _current_action;

    public:
        Action();
        Action(std::string action_);
        ActionResult operator=(std::string action_);
        std::string _get_current_action();

        bool operator==(Action);
        bool operator==(std::string);
};

#endif
